/**
 * IMAGE TASK
 * @Author: jiangcheng198745@hotmail.com
 * @Date: 2016/07/06
 */
'use strict';

import gulp from 'gulp';
import imagemin from 'gulp-imagemin';

import config from '../gulp.config';
import messageLogger from '../utils/message.gulp';



gulp.task('image-min', (done) => {
    messageLogger('Compressing images for dist');

    gulp.src(config.build + '/**/*.{ico,png,jpg,gif}')
    .pipe(imagemin({
        optimizationLevel: 5
    }))
    .pipe(gulp.dest(config.dist))
    .on('end', done);
});